package hn.cch.spring.boot.message;

import lombok.Data;

@Data
public class Response<T> {

    private String code;
    private T data;

    public static <T> Response<T> success(T data){
        Response<T> response = new Response<T>();
        response.code = "success";
        response.data = data;
        return response;
    }

    public static Response<String> failure(String message){
        Response<String> response = new Response<>();
        response.code = "failure";
        response.data = message;
        return response;
    }
}
